package com.itheima.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.po.Comment;
import com.itheima.dao.CommentDao;
import com.itheima.service.CommentService;
@Service("CommentService")
@Transactional
public class CommentServiceImpl implements CommentService {
	@Autowired
	private CommentDao commentDao;
	public int addComment(Comment comment) {
		return commentDao.addComment(comment);
	}
	@Override
	public List<Comment> getBookComments(int bookid) {
		return commentDao.getBookComments(bookid);
	}
	@Override
	public List<Comment> getUncheckedComments() {
		// TODO Auto-generated method stub
		return commentDao.getUncheckedComments();
	}
	@Override
	public int checkComment(int commentid) {
		// TODO Auto-generated method stub
		return commentDao.checkComment(commentid);
	}
	@Override
	public int deleteComment(int commentid) {
		// TODO Auto-generated method stub
		return commentDao.deleteComment(commentid);
	}
	@Override
	public List<Comment> getUserComments(String userid) {
		// TODO Auto-generated method stub
		return commentDao.getUserComments(userid);
	}
	@Override
	public List<Integer> getStarList(int bookid) {
		// TODO Auto-generated method stub
		return commentDao.getStarList(bookid);
	}
	@Override
	public List<Comment> getCheckedComments() {
		// TODO Auto-generated method stub
		return commentDao.getCheckedComments();
	}
}
